libxl, docs: Use arch-specific default paging memory
authorHenry Wang <Henry.Wang@arm.com>
Tue, 11 Oct 2022 12:55:08 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 12:55:08 +0000 (14:55 +0200)
commit755a9b52844de3e1e47aa1fc9991a4240ccfbf35
tree2cce529f8115aaca6f70a7a33d684ab7e3704630
parenta603386b422f5cb4c5e2639a7e20a1d99dba2175
libxl, docs: Use arch-specific default paging memory

The default paging memory (descibed in `shadow_memory` entry in xl
config) in libxl is used to determine the memory pool size for xl
guests. Currently this size is only used for x86, and contains a part
of RAM to shadow the resident processes. Since on Arm there is no
shadow mode guests, so the part of RAM to shadow the resident processes
is not necessary. Therefore, this commit splits the function
`libxl_get_required_shadow_memory()` to arch specific helpers and
renamed the helper to `libxl__arch_get_required_paging_memory()`.

On x86, this helper calls the original value from
`libxl_get_required_shadow_memory()` so no functional change intended.

On Arm, this helper returns 1MB per vcpu plus 4KB per MiB of RAM
for the P2M map and additional 512KB.

Also update the xl.cfg documentation to add Arm documentation
according to code changes and correct the comment style following Xen
coding style.

This is part of CVE-2022-33747 / XSA-409.

Suggested-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
master commit: 156a239ea288972425f967ac807b3cb5b5e14874
master date: 2022-10-11 14:28:37 +0200
docs/man/xl.cfg.5.pod.in
tools/libs/light/libxl_arch.h
tools/libs/light/libxl_arm.c
tools/libs/light/libxl_utils.c
tools/libs/light/libxl_x86.c